package com.example.springboot.mapper;

import cn.hutool.core.date.DateTime;
import com.example.springboot.pojo.Validation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ValidationMapper {

    @Insert("insert into validation(email,code,time) values(#{email},#{code},#{time})")
    void saveCode(String email, String code, DateTime time);

    @Select("select * from validation where email=#{email}")
    Validation[] findValidation(String email);

    @Delete("delete from validation where email=#{email}")
    void deleteValidation(String email);
}
